package com.medical.controller;

import com.medical.pojo.SubitemUsage;
import com.medical.service.SubitemUsageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("subitemUsage")
public class SubitemUsageController {

    @Autowired
    private SubitemUsageService subitemUsageService;

    @RequestMapping("/list")
    public List<SubitemUsage> findAll(@RequestBody SubitemUsage subitemUsage){
        return subitemUsageService.findAll(subitemUsage);
    }

    @RequestMapping("/findAllItem")
    public List<List<String>> findAllItem(@RequestBody SubitemUsage subitemUsage){
        return subitemUsageService.findAllItem(subitemUsage);
    }

    @RequestMapping("/findPieChartItem")
    public List<Map<String,String>> findPieChartItem(@RequestBody SubitemUsage subitemUsage){
        return subitemUsageService.findPieChartItem(subitemUsage);
    }
}
